package com.leyou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.pojo.Category;
import com.leyou.pojo.CategoryBrand;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author jshstart
 * @creat 2020-12-09 17:19
 */
public interface CategoryBrandMapper extends BaseMapper<CategoryBrand> {
    @Select("select brand_id from tb_category_brand where category_id=#{id}")
    List<Long> queryBrandId(Long id);
    @Insert("insert into tb_category_brand value(#{categoryId},#{brandId}) ")
    void add(@Param("brandId") Long brandId, @Param("categoryId")Long categoryId);

    @Delete("delete from tb_category_brand where brand_id=#{BrandId}")
    void deleteByBrandId(Long BrandId);
}
